package com.maxversion.websocket.controller;

import com.maxversion.websocket.websocket.client.WebSocketServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 刘军保
 * @version V1.0
 * @title: IndexController
 * @date 2021年08月15日 21:40
 **/
@RestController
@RequestMapping("/websocket")
public class IndexController {

    @Autowired
    private WebSocketServiceImpl webSocketService;

    @GetMapping("/sendMessage")
    public String sendMessage(String message){
        webSocketService.groupSending(message);
        return message;
    }
}
